from django.conf.urls import url

from apps.users import views
from rest_framework_jwt.views import obtain_jwt_token

urlpatterns = [
    # /users/usernames/(?P<username>\w{5,20})/count/
    url(r'^usernames/(?P<username>\w{5,20})/count/$',views.RegisterUsernameCountAPIView.as_view(),name='usernamecount'),
    # /users/phones/(?P<mobile>1[345789]\d{9})/count/
    url(r'^phones/(?P<mobile>1[345789]\d{9})/count/$', views.RegisterPhoneCountAPIView.as_view()),

    url(r'^$', views.CreateUserView.as_view()),

    # 进行登录认证，返回token
    # /users/auths/
    url(r'^auths/$', obtain_jwt_token),

    # /users/infos/   个人信息
    url(r'^infos/$', views.UserCenterInfoView.as_view()),

    # /users/emails/  个人信息设置邮箱时
    url(r'^emails/$', views.EmailView.as_view()),

    # /users/emails/verification/  邮箱验证
    url(r'^emails/verification/$', views.EmailVerifyView.as_view()),

    # /users/browerhistories/  用户浏览记录
    url(r'^browerhistories/$', views.UserHistoryView.as_view(), name='history'),

]